package com.ruoyi.common.core.domain.entity.socket.bean;

import com.ruoyi.common.constant.socket.DeviceTypeContant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * 泡泡豚船只故障码信息。
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BoatErrorCodeInfo extends BaseDataPiece {

    @Data
    public static class BoatErrorCode {
        public int spn;
        public byte fmi;
        public byte cm;
        public byte oc;
    }

    private List<BoatErrorCode> boatErrorCodeList = new ArrayList<>();

    public BoatErrorCodeInfo(byte systemCode, byte deviceCode) {
        super(systemCode, deviceCode);
    }

    @Override
    public int getDataPieceLength() {
        return 50;
    }

    @Override
    public void setDeviceType() {
        deviceType = DeviceTypeContant.BoatErrorCodeInfo;
    }
}
